package com.fdd.op.demo;

import com.fdd.op.sdk.ApiException;
import com.fdd.op.sdk.DefaultFddClient;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.token.FddTokenStore;
import com.fdd.op.sdk.internal.token.stroe.CacheTokenStoreImpl;
import com.fdd.op.sdk.request.api.account.QueryUserAndRoleRequest;
import com.fdd.op.sdk.request.api.contract.CheckSignatureRequest;
import com.fdd.op.sdk.request.api.contract.GetDocListByContractIdRequest;
import com.fdd.op.sdk.response.api.account.QueryUserAndRoleResponse;
import com.fdd.op.sdk.response.api.contract.CheckSignatureResponse;
import com.fdd.op.sdk.response.api.contract.GetDocListByContractIdResponse;

/**
 * @description: 定制-通过合同id查询文档下载地址等详细信息
 * @author lijiaxin@fadada.com
 * @date 2023/9/14 15:34
 */
public class GetDocListByContractIdApi {
    private static String serverUrl = "http://10.21.8.20:37801";
    private static final String appId = "486478";
    private static final String appKey = "xguUMVFnDzqJgfVEDnLW16yE2mxVL2Fp";

    public static void main(String[] args) throws ApiException {
        FddTokenStore tokenStore = new CacheTokenStoreImpl();
        DefaultFddClient fddClient = new DefaultFddClient(serverUrl, appId, appKey, Constants.AUTH_OAUTH, 1000, 30000);
        fddClient.tokenStore(tokenStore);
        GetDocListByContractIdRequest request = new GetDocListByContractIdRequest();
        request.setDocId("357526092577013760");
        //request.setAccessCode("12345a");
        GetDocListByContractIdResponse response = fddClient.execute(request);
        if(response != null && "0".equals(response.getCode())){
            System.out.println(response.getData());
        }
    }
}
